// 出库相关API
window.stockOutAPI = {
    // 获取出库记录
    getStockOutRecords: async (params = {}) => {
        try {
            const response = await apiClient.get('/api/stock-out/', { params });
            return response;
        } catch (error) {
            console.error('获取出库记录失败:', error);
            throw error;
        }
    },
    
    // 获取出库记录详情
    getStockOutRecord: async (id) => {
        try {
            const response = await apiClient.get(`/api/stock-out/${id}`);
            return response;
        } catch (error) {
            console.error('获取出库记录详情失败:', error);
            throw error;
        }
    },
    
    // 创建出库记录
    createStockOutRecord: async (data) => {
        try {
            const response = await apiClient.post('/api/stock-out', data);
            return response;
        } catch (error) {
            console.error('创建出库记录失败:', error);
            throw error;
        }
    },
    
    // 更新出库记录
    updateStockOutRecord: async (id, data) => {
        try {
            const response = await apiClient.put(`/api/stock-out/${id}`, data);
            return response;
        } catch (error) {
            console.error('更新出库记录失败:', error);
            throw error;
        }
    },
    
    // 删除出库记录
    deleteStockOutRecord: async (id) => {
        try {
            const response = await apiClient.delete(`/api/stock-out/${id}`);
            return response;
        } catch (error) {
            console.error('删除出库记录失败:', error);
            throw error;
        }
    },
    
    // 获取出库统计
    getStatistics: async (params = {}) => {
        try {
            const response = await apiClient.get('/api/stock-out/statistics', { params });
            return response;
        } catch (error) {
            console.error('获取出库统计失败:', error);
            throw error;
        }
    }
};
